Skip to content

Conversation

@Turbo87
Copy link
Member

@Turbo87 Turbo87 commented Feb 13, 2025

Out of the roughly 1100 teams in our database only 10 have org_id: NULL. These teams belong to GitHub organizations that don't exist anymore, so the corresponding teams are essentially useless. See #2796 (comment) for more context.

Since the nullability of the column makes our code more complicated than it needs to be, this commit proposes to remove these teams and turn the column into a not null column.

@Turbo87 Turbo87 added C-internal 🔧 Category: Nonessential work that would make the codebase more consistent or clear A-backend ⚙️ labels Feb 13, 2025
@Turbo87 Turbo87 requested a review from a team February 13, 2025 08:58
@Turbo87 Turbo87 force-pushed the non-null-org-id branch 4 times, most recently from d8daac5 to 59252a1 Compare February 14, 2025 09:23
Copy link
Contributor

@eth3lbert eth3lbert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The migration SQL looks good to me.


Looking at just the migration script, this seems like an irreversible change that could result in data loss. We probably won't need to revert it, but I'm wondering if there's a good way to undo this type of irreversible migration, including the data?

@Turbo87
Copy link
Member Author

Turbo87 commented Feb 14, 2025

Looking at just the migration script, this seems like an irreversible change that could result in data loss. We probably won't need to revert it, but I'm wondering if there's a good way to undo this type of irreversible migration, including the data?

if it's necessary to restore it, we have the original data in the current database dump and can restore it from there.

Copy link
Contributor

@eth3lbert eth3lbert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With a backup, I don't see a problem with this.

@Turbo87 Turbo87 enabled auto-merge (squash) February 14, 2025 15:49
Out of the roughly 1100 teams in our database only 10 have `org_id: NULL`. These teams belong to GitHub organizations that don't exist anymore, so the corresponding teams are essentially useless. See rust-lang#2796 (comment) for more context.

Since the nullability of the column makes our code more complicated than it needs to be, this commit proposes to remove these teams and turn the column into a `not null` column.
@Turbo87 Turbo87 merged commit 659c1c8 into rust-lang:main Feb 14, 2025
10 checks passed
@Turbo87 Turbo87 deleted the non-null-org-id branch February 14, 2025 16:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-backend ⚙️ C-internal 🔧 Category: Nonessential work that would make the codebase more consistent or clear

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

2 participants